package cmusm.yuan.jfklearn;

import javafx.application.Application;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

public class HelloJFX extends Application {

    @Override
    public void start(Stage stage) throws Exception {

        stage.setScene(new Scene(createParent(), 300, 300, Color.GRAY));
        stage.show();
    }

    public static void start(String[] args) {
        launch();
    }

    private Parent createParent() {
        Rectangle rectangle = new Rectangle(100, 50, Color.BLUE);
        transform(rectangle);
        return new Pane(rectangle);
    }

    public void transform(Rectangle box) {
        //do sth
    }
}
